package com.wesh.user.controller;

import com.wesh.user.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RestController
@RequestMapping("/index")
@RefreshScope
public class IndexController {

    //@Value("${user.token}")
    private String token;

    @Autowired
    private IndexService indexService;

    @GetMapping("config")
    public String config(){
        return token;
    }

    @PostConstruct
    public void init(){
        System.out.println("@PostConstruct 初始化...");
    }

}
